This application is based upon and claims the benefit of priority from the prior Japanese Patent Applications Nos. 2000-254064, filed Aug. 24, 2000, and 2001-251988 filed Aug. 22, 2001, the entire contents of both of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to a technology for detecting a three-dimensional graphic, which has a specific positional relationship with a predetermined point in an image made up of at least one three-dimensional graphic.
2. Description of the Related Art
Entertainment apparatuses such as video game machines with improved image processing capacities are capable of providing more realistic game images. For example, there are many video games displaying images such as an object or character moving around in a three-dimensional space that allow the player to experience the realism of a live performance and to be immersed in the game world.
Some of these video games present characters such as people and automobiles in a three-dimensional image made up of various objects, which are manipulatable by the player and exert some influences upon the objects. For example, an automobile (character) running in an auto race game dashes off a stone (object) on the road or a person (character) lifts a nearby object, etc.
Some video games use a positional relationship between the character and object as a condition that enables the character to exert an influence on the object in the three-dimensional image. This allows the character to exert an influence on the object only when the character and object have a specific positional relationship.
The positional relationship between the character and object may be such a positional relationship that, when, for example, a three-dimensional image is projected onto an XY plane in the orthogonal coordinate system made up of X, Y and Z axes, projecting points of points expressing the position of the character overlap the projected image (two-dimensional projected image) of the object (the character exists above or below the object) or such a positional relationship that the two-dimensional projected image of the object among the plurality of objects on the XY plane approaches closest to the above-described projecting points (object that approaches closest to the character when viewed from a high place in the air), etc.
Information on graphics that express individual objects such as stone and road that make up an image is controlled by a table, etc.
The table includes information necessary to display the graphics such as positional coordinates expressing the positions of the respective graphics and texture coordinates and the information is updated every time the positional coordinates, etc. change.
This table is configured according to the order in which objects are created and sorting by the positional coordinates expressing the positions of the graphics in the image is not performed. For example, the table is not intended to control graphics in the order of sorting based on the X coordinate. As described above, in order for a character to exert some influence on an object, it is necessary to examine whether the character and object have a specific positional relationship or not. For this purpose, it is necessary to scan the whole table and examine the positional relationship between the graphics expressing the respective objects and the character. For example, in order to examine whether an object exists below an automobile or not in an auto race game, it is necessary to examine the positional relationship between the automobile and the respective objects from the positional coordinates of the automobile and the positional coordinates of all graphics recorded in the table.
Scanning the whole table is extremely time-consuming processing. A possible way of speeding up this processing is sorting by the positional coordinate of graphics beforehand. This requires, however, two kinds of table; a table containing the sorting result and the original table, to be maintained, thus consuming an extra memory area. Furthermore, when images are created in real time as the game progresses, sorting must also be carried out in real time, which may slow down the processing speed.
Furthermore, the positional relationship between the character and object is conventionally examined using points (vertices, etc.) that determine the respective shapes. For this reason, depending on the shape of the object, specified graphics may not be found in a desired positional relationship. For example, when it is desired to detect an object that approaches closest to a character, though a graphics is judged to be closest to the object from a comparison of the distance between vertices, there may be actually another graphics, which is closer to the object.
It is a subject of the present invention to provide a technology for detecting a graphics that expresses an object which is in a specific positional relationship with specific points in a three-dimensional image, for example, points expressing the position of a character, without wasting hardware resources or reducing the processing speed.
It is another subject of the present invention to provide a technology for detecting a graphics that expresses an object, which is in a specific positional relationship with specific points in a three-dimensional image independently of the shape of an object.
The present invention proposes a specific mechanism for detecting graphics of an object from a positional relationship on a two-dimensional projected image between a predetermined point in a three-dimensional image and the graphics expressing the object using the function of forming a two-dimensional image (two-dimensional projected image) by projecting a three-dimensional image from a predetermined direction, which is provided as standard for an image processing apparatus implemented by an entertainment apparatus such as a general-purpose computer and video game machine. More specifically, the present invention provides a graphics detection method, graphics detection apparatus, semiconductor device and computer program.
The graphics detection method of the present invention is a graphics detection method executed by an apparatus for detecting a three-dimensional graphic which has a specific positional relationship with a predetermined point in an image configured by including a three-dimensional graphic, comprising a first stage of adding identification information for identifying the three-dimensional graphics to the three-dimensional graphics, a second stage of adding to a two-dimensional projected image formed by projecting individual three-dimensional graphics onto a predetermined plane the identification information corresponding to the identification information added to the three-dimensional graphics and a third stage of detecting the identification information added to the two-dimensional projected image when there are projecting points of the specific points within the two-dimensional projected image and detecting the three-dimensional graphics to which the identification information corresponding to the detected identification information is added.
xe2x80x9cPredetermined pointsxe2x80x9d refer to, for example, points indicating the position of a character or object. The predetermined point make it possible to detect a graphics having such a positional relationship that projecting points are included in the two-dimensional projected image.
Generating a two-dimensional projected image from a three-dimensional graphic using the function provided for the conventional image processing apparatus as described above makes it possible to detect the graphics without consuming extra hardware resources. Detecting identification information from the two-dimensional projected image and detecting the three-dimensional graphics having the detected identification information allows graphics to be detected speedily without being affected by the number of three-dimensional graphics. Adding identification information to the two-dimensional projected image makes it possible to detect a three-dimensional graphic having a specific positional relationship with a predetermined point also taking into account the shape of the two-dimensional projected image.
When a three-dimensional graphic is projected onto a predetermined plane and a two-dimensional projected image is formed, either one of the following three modes can be selected:
(1) Without expanding or contracting the three-dimensional graphics or two-dimensional projected image, the same identification information is added to both to identify them respectively.
(2) A plurality of two-dimensional images formed by expanding or contracting a three-dimensional graphic with a plurality of mutually different levels of magnification ratio or contraction ratio and then projecting the three-dimensional graphics is overlapped one atop another to form gradation, and identification information which differs according to the level of magnification ratio or contraction ratio is added to the respective two-dimensional projected images. The projected images in this case can be orthographic projected images (expansion or contraction of the three-dimensional graphics) or perspective projected images (the magnification ratio of projection is changed while the three-dimensional graphics remains the same).
(3) When a three-dimensional graphic is expanded or contracted, it is also possible to gradually change the identification information to be added thereto according to the magnification ratio or contraction ratio and the distance from the center of magnification or contraction. Furthermore, the identification information is made variable following the variation in the magnification ratio or contraction ratio to make the direction in which the identification information changes identical to the direction in which the magnification ratio or contraction ratio changes. This method can be easily implemented using a smooth shading function provided as standard for an apparatus handling computer graphics.
It is also possible to form gradation while gradually expanding or contracting the graphics or form gradation at a stroke from the beginning. The first one is the processing method suited to a case where there is enough processing time for two-dimensional projected images whereas there is not enough processing field for drawing the two-dimensional projected images (image memory, etc.). The second one is the opposite. The narrower the gradation and the greater the number of steps of gradation, the finer expression can be realized.
It is also possible to expand or contract the two-dimensional projected image in order that one piece of identification information is detected. Expanding the two-dimensional projected image makes it possible to detect a two-dimensional projected image closest to the projecting point. Contracting the two-dimensional projected image makes it possible to detect a two-dimensional projected image closest to the center at the projecting point.
In the above methods (2) and (3), it is also possible to include in the identification information, addition information which changes according to the size of the three-dimensional graphics and change the addition information according to the degree of expansion or contraction and the distance from the center of magnification or contraction when the two-dimensional projected image is expanded or contracted and detect the degree of closeness between the two-dimensional projected image and the projecting points according to the changed addition information. In this case, if, for example, the identification information is expressed with a numerical value of a plurality of digits, a numerical value of at least one of the plurality of digits identifies the three-dimensional graphics and a numerical value of at least one of the rest of digits is the addition information, then the three-dimensional graphics can be detected even if the addition information changes.
Or it is also possible to express the identification information using a numerical value to uniquely identify the three-dimensional graphics and change this numerical value in stages according to the level of the magnification ratio or contraction ratio of the two-dimensional projected image or the distance from the center of magnification or contraction to make it possible to detect the degree of closeness between the two-dimensional projected image and said projecting point based on this numerical value.
It is also possible to add identification information, which is not added to any three-dimensional graphics to the area where the two-dimensional projected image is not formed when the image is projected onto the plane. This makes it possible, for example, to determine speedily from the detected identification information whether it is the area where the three-dimensional graphics is projected or not.
It is also possible to form a plurality of two-dimensional projected images to determine a three-dimensional graphic. For example, in the second stage, the three-dimensional image is projected onto a plurality of different planes to form a plurality of two-dimensional projected images respectively and the identification information corresponding to the identification information added to the three-dimensional graphics is added to the two-dimensional projected images on the respective planes, and in the third stage, when the projecting points exist in the plurality of two-dimensional projected images, the identification information added to the two-dimensional projected images are detected and a three-dimensional graphic is detected based on the detected identification information.
According to this method, detecting, for example, in the third stage, the three-dimensional graphics to which the identification information commonly detected in all of the plurality of two-dimensional projected images is added, or a three-dimensional graphic for which the numerical values of identification information in all of said plurality of two-dimensional projected images fall within the respective ranges assigned thereto respectively, both make it possible to readily detect the three-dimensional graphics in a position including the predetermined point in the three-dimensional graphic.
The graphics detection apparatus of the present invention is a graphics detection apparatus for detecting a three-dimensional graphic which has a specific positional relationship with a predetermined point in an image configured by including a three-dimensional graphic, comprising means for adding identification information for identifying the three-dimensional graphics to the three-dimensional graphics, drawing means for adding to a two-dimensional projected image formed by projecting individual three-dimensional graphics onto a predetermined plane the identification information corresponding to the identification information added to the three-dimensional graphics and detecting means for detecting the identification information added to the two-dimensional projected image when there are projecting points of the specific points within the two-dimensional projected image and detecting the three-dimensional graphics to which the identification information corresponding to the detected identification information is added.
The semiconductor device of the present invention is a semiconductor device for detecting a three-dimensional graphic which has a specific positional relationship with a predetermined point in an image configured by including a three-dimensional graphic, comprising means for adding identification information for identifying the three-dimensional graphics to the three-dimensional graphics, means for adding to a two-dimensional projected image formed by projecting individual three-dimensional graphics onto a predetermined plane the identification information corresponding to the identification information added to the three-dimensional graphics and means for detecting the identification information added to the two-dimensional projected image when there are projecting points of the specific points within the two-dimensional projected image and detecting the three-dimensional graphics to which the identification information corresponding to the detected identification information is added.
The computer program of the present invention is a computer program for rendering a computer to serve as a graphics detection apparatus for detecting a three-dimensional graphic which has a specific positional relationship with a predetermined point in an image configured by including a three-dimensional graphic, the graphics detection apparatus comprising a step of adding identification information for identifying the three-dimensional graphics to the three-dimensional graphics, a step of adding to a two-dimensional projected image formed by projecting individual three-dimensional graphics onto a predetermined plane the same identification information as the identification information added to the three-dimensional graphics and a step of detecting the identification information added to the two-dimensional projected image when there are projecting points of the specific points within the two-dimensional projected image and detecting the three-dimensional graphics to which the identification information corresponding to the detected identification information is added.